Namespaces | |
namespace | fallback |
Classes | |
class | BasicLinearMatrixSolverImplementation |
struct | base_unary_function |
struct | setvalue |
struct | addvalue |
struct | multiplyvalue |
struct | absvalue |
struct | absvalue< RealType > |
struct | absvalue< ComplexType > |
struct | exponential |
struct | reciprocal |
struct | conjugate_value |
struct | real_value |
struct | imaginary_value |
struct | base_accumulator_function |
struct | l1_norm |
struct | l2_norm |
struct | infinity_norm |
struct | base_binary_function |
struct | multiplyvalue2 |
struct | dividevalue2 |
struct | scaleAdd2 |
class | DAESolverT |
A solver for systems differential algebraic equations (DAE). More... | |
struct | DAEBuilder |
class | DAESolverImplementation |
class | DAESolverInterface |
class | ImplementationVisitable |
Interface for classes that accept ImplementationVisitor's. More... | |
class | ImplementationVisitor |
class | ConstImplementationVisitor |
class | LinearMatrixSolverT |
A solver for multiple systems of linear equations. More... | |
class | LinearMatrixSolverImplementation |
class | BaseLinearMatrixSolverInterface |
class | LinearSolverT |
A solver for system(s) of linear equations in parallel. More... | |
class | LinearSolverImplementation |
class | BaseLinearSolverInterface |
class | MatrixT |
A parallel or serial matrix of real values. More... | |
class | MatrixImplementation |
class | BaseMatrixInterface |
Abstract interface for matrix classes. More... | |
class | NewtonRaphsonSolverT |
Solve a system of nonlinear equations using the Newton-Raphson method in parallel. More... | |
class | NewtonRaphsonSolverImplementation |
Implementation of Newton-Raphson method to solve a system of nonlinear equations in parallel. More... | |
class | NonlinearSolverT |
A solver for a system of nonlinear system of equations in parallel. More... | |
struct | NLSBuilder |
class | NonlinearSolverImplementation |
class | NonlinearSolverInterface |
Interface to a solve system of nonlinear equations in parallel. More... | |
struct | TypeCheck |
This is used to make sure the numeric type is supported. More... | |
class | ValueTransfer |
class | ValueTransferToLibrary |
class | ValueTransferFromLibrary |
class | MatrixValueTransferToLibrary |
class | MatrixValueTransferFromLibrary |
struct | storage_size |
Get the number of library elements used to represent a scalar. More... | |
class | VectorT |
A parallel or serial vector of values. More... | |
class | VectorImplementation |
class | BaseVectorInterface |
Typedefs | |
typedef DAESolverT< ComplexType > | ComplexDAESolver |
typedef DAESolverT< RealType > | RealDAESolver |
typedef ComplexDAESolver | DAESolver |
typedef LinearMatrixSolverT < ComplexType > | ComplexLinearMatrixSolver |
typedef LinearMatrixSolverT < RealType > | RealLinearMatrixSolver |
typedef ComplexLinearMatrixSolver | LinearMatrixSolver |
typedef LinearSolverT < ComplexType > | ComplexLinearSolver |
typedef LinearSolverT< RealType > | RealLinearSolver |
typedef ComplexLinearSolver | LinearSolver |
typedef MatrixT< ComplexType > | ComplexMatrix |
typedef MatrixT< RealType > | RealMatrix |
typedef ComplexMatrix | Matrix |
The main matrix type. | |
typedef NewtonRaphsonSolverT < ComplexType > | ComplexNewtonRaphsonSolver |
typedef NewtonRaphsonSolverT < RealType > | RealNewtonRaphsonSolver |
typedef ComplexNewtonRaphsonSolver | NewtonRaphsonSolver |
typedef NonlinearSolverT < ComplexType > | ComplexNonlinearSolver |
typedef NonlinearSolverT < RealType > | RealNonlinearSolver |
typedef ComplexNonlinearSolver | NonlinearSolver |
typedef NLSBuilder < ComplexType >::Jacobian | ComplexJacobianBuilder |
typedef NLSBuilder < ComplexType >::Function | ComplexFunctionBuilder |
typedef NLSBuilder< RealType > ::Jacobian | RealJacobianBuilder |
typedef NLSBuilder< RealType > ::Function | RealFunctionBuilder |
typedef class VectorT < ComplexType > | ComplexVector |
typedef class VectorT< double > | RealVector |
typedef ComplexVector | Vector |
Enumerations | |
enum | MatrixStorageType { Dense, Sparse } |
The types of matrices that can be created. More... | |
Functions | |
template<typename To , typename From > | |
To | equate (const From &f) |
template<> | |
RealType | equate< RealType, ComplexType > (const ComplexType &f) |
template<typename T , typename StorageType > | |
void | unary_operation (const unsigned int &size, StorageType *x, base_unary_function< T > &op) |
template<> | |
void | unary_operation< ComplexType, RealType > (const unsigned int &size, RealType *x, base_unary_function< ComplexType > &op) |
template<> | |
void | unary_operation< RealType, ComplexType > (const unsigned int &size, ComplexType *x, base_unary_function< RealType > &op) |
template<typename T , typename StorageType > | |
void | accumulator_operation (const unsigned int &size, const StorageType *x, base_accumulator_function< T, RealType > &op) |
template<> | |
void | accumulator_operation< RealType, ComplexType > (const unsigned int &size, const ComplexType *x, base_accumulator_function< RealType, RealType > &op) |
template<> | |
void | accumulator_operation< ComplexType, RealType > (const unsigned int &size, const RealType *x, base_accumulator_function< ComplexType, RealType > &op) |
template<typename T , typename StorageType > | |
void | binary_operation (const unsigned int &size, StorageType *x1, const StorageType *x2, base_binary_function< T > &op) |
template<> | |
void | binary_operation< ComplexType, RealType > (const unsigned int &size, RealType *x1, const RealType *x2, base_binary_function< ComplexType > &op) |
template<> | |
void | binary_operation< RealType, ComplexType > (const unsigned int &size, ComplexType *x1, const ComplexType *x2, base_binary_function< RealType > &op) |
void | Initialize (int *, char ***) |
bool | Initialized (void) |
Is the math library initialized? | |
void | Finalize (void) |
Do whatever is necessary to shut down the math library. | |
template<typename T , typename I > | |
void | add (const MatrixT< T, I > &A, const MatrixT< T, I > &B, MatrixT< T, I > &result) |
Add two Matrix instances and put the result in a third. | |
template<typename T , typename I > | |
void | transpose (const MatrixT< T, I > &A, MatrixT< T, I > &result) |
Make the transpose of a Matrix and put it in another. | |
template<typename T , typename I > | |
void | column (const MatrixT< T, I > &A, const int &cidx, VectorT< T, I > &x) |
Get a column from the Matrix and put in specified Vector. | |
template<typename T , typename I > | |
void | diagonal (const MatrixT< T, I > &A, VectorT< T, I > &x) |
Get the diagonal from a Matrix and put it in specified Vector. | |
template<typename T , typename I > | |
void | multiply (const MatrixT< T, I > &A, const MatrixT< T, I > &B, MatrixT< T, I > &result) |
Multiply two Matrix instances and put result in existing Matrix. | |
template<typename T , typename I > | |
void | multiply (const MatrixT< T, I > &A, const VectorT< T, I > &x, VectorT< T, I > &result) |
Multiply a Matrix by a Vector and put result in existing Vector. | |
template<typename T , typename I > | |
void | transposeMultiply (const MatrixT< T, I > &A, const VectorT< T, I > &x, VectorT< T, I > &result) |
Multiply the transpose of a Matrix by a Vector and put the result in existing Vector. | |
template<typename T , typename I > | |
MatrixT< T, I > * | add (const MatrixT< T, I > &A, const MatrixT< T, I > &B) |
Add two Matrix instances. | |
template<typename T , typename I > | |
MatrixT< T, I > * | transpose (const MatrixT< T, I > &A) |
Make the transpose of a Matrix. | |
template<typename T , typename I > | |
VectorT< T, I > * | column (const MatrixT< T, I > &A, const int &cidx) |
Get a column from the Matrix and put in new Vector. | |
template<typename T , typename I > | |
VectorT< T, I > * | diagonal (const MatrixT< T, I > &A) |
Get the diagonal from a Matrix and put in new Vector. | |
template<typename T , typename I > | |
MatrixT< T, I > * | diagonal (const VectorT< T, I > &x, const MatrixStorageType &stype=Sparse) |
Make a diagonal Matrix from a Vector. | |
template<typename T , typename I > | |
MatrixT< T, I > * | multiply (const MatrixT< T, I > &A, const MatrixT< T, I > &B) |
Multiply two Matrix instances and make a new one. | |
template<typename T , typename I > | |
VectorT< T, I > * | multiply (const MatrixT< T, I > &A, const VectorT< T, I > &x) |
Multiply a Matrix by a Vector and make a new Vector for the result. | |
template<typename T , typename I > | |
VectorT< T, I > * | transposeMultiply (const MatrixT< T, I > &A, const VectorT< T, I > &x) |
Multiply the transpose of a Matrix by a Vector and make a new Vector for the result. | |
template<typename T , typename I > | |
MatrixT< T, I > * | identity (const MatrixT< T, I > &A) |
Make an identity matrix with the same ownership as the specified matrix. | |
template<typename T , typename I > | |
MatrixT< T, I > * | real (const MatrixT< T, I > &A) |
Create a new matrix containing the real part of the specified matrix. | |
template<typename T , typename I > | |
MatrixT< T, I > * | imaginary (const MatrixT< T, I > &A) |
Create a new matrix containing the imaginary part of the specified matrix. | |
template<typename T , typename I > | |
MatrixT< T, I > * | conjugate (const MatrixT< T, I > &A) |
Create a new matrix containing the complex conjugate of the specified matrix. | |
template<typename T , typename I > | |
MatrixT< T, I > * | storageType (const MatrixT< T, I > &A, const MatrixStorageType &new_type) |
Create a copy of a Matrix, possibly with a different storage type. | |
template<typename T , typename I > | |
MatrixT< T, I > * | matrixLoadBinary (const parallel::Communicator &comm, const char *filename) |
Create a new matrix and load its contents from the specified (binary) file. | |
template<typename T , typename I > | |
VectorT< T, I > * | add (const VectorT< T, I > &A, const VectorT< T, I > &B) |
Add two Vector instances and put the result in a new one. | |
template<typename T , typename I > | |
VectorT< T, I > * | abs (const VectorT< T, I > &x) |
Subtract two Vector instances and put the result in a new one. | |
template<typename T , typename I > | |
VectorT< T, I > * | real (const VectorT< T, I > &x) |
Create a vector containing the real part of the specified vector. | |
template<typename T , typename I > | |
VectorT< T, I > * | imaginary (const VectorT< T, I > &x) |
Create a vector containing the imaginar part of the specified vector. | |
template<typename T , typename I > | |
VectorT< T, I > * | conjugate (const VectorT< T, I > &x) |
Create a vector containing the complex conjugate of x . | |
template<typename T , typename I > | |
void | add (const VectorT< T, I > &A, const VectorT< T, I > &B, VectorT< T, I > &result) |
Add two Vector instances and put the result in an existing Vector. |
typedef NLSBuilder<ComplexType>::Function gridpack::math::ComplexFunctionBuilder |
typedef NLSBuilder<ComplexType>::Jacobian gridpack::math::ComplexJacobianBuilder |
typedef class VectorT< ComplexType > gridpack::math::ComplexVector |
typedef ComplexMatrix gridpack::math::Matrix |
The main matrix type.
typedef NLSBuilder<RealType>::Function gridpack::math::RealFunctionBuilder |
typedef NLSBuilder<RealType>::Jacobian gridpack::math::RealJacobianBuilder |
typedef MatrixT<RealType> gridpack::math::RealMatrix |
typedef class VectorT< double > gridpack::math::RealVector |
typedef ComplexVector gridpack::math::Vector |
The types of matrices that can be created.
The gridpack::math library provides two storage schemes for matrices. This is used by Matrix and MatrixImplementation subclasses.
The actual storage scheme and memory used is dependent upon the underlying math library implementation.
VectorT<T, I>* gridpack::math::abs | ( | const VectorT< T, I > & | x | ) |
Subtract two Vector instances and put the result in a new one.
Collective.
A
and B
must have the global size and use the same communicator, but may have different local sizes.
The resultant vector instance will have the same parallel distribution as A
.
A | ||
B |
References gridpack::math::VectorT< T, I >::clone().
void gridpack::math::accumulator_operation | ( | const unsigned int & | size, | |
const StorageType * | x, | |||
base_accumulator_function< T, RealType > & | op | |||
) |
void gridpack::math::accumulator_operation< ComplexType, RealType > | ( | const unsigned int & | size, | |
const RealType * | x, | |||
base_accumulator_function< ComplexType, RealType > & | op | |||
) |
void gridpack::math::accumulator_operation< RealType, ComplexType > | ( | const unsigned int & | size, | |
const ComplexType * | x, | |||
base_accumulator_function< RealType, RealType > & | op | |||
) |
void gridpack::math::add | ( | const VectorT< T, I > & | A, | |
const VectorT< T, I > & | B, | |||
VectorT< T, I > & | result | |||
) |
Add two Vector instances and put the result in an existing Vector.
Collective.
A
, B
, and result
need to have the same global size and use the same communicator, but may have different local sizes.
A | ||
B | ||
result | vector in which to place the sum of A and B |
References gridpack::math::VectorT< T, I >::add(), and gridpack::math::VectorT< T, I >::equate().
VectorT<T, I>* gridpack::math::add | ( | const VectorT< T, I > & | A, | |
const VectorT< T, I > & | B | |||
) |
Add two Vector instances and put the result in a new one.
Collective.
A
and B
must have the global size and use the same communicator, but may have different local sizes.
The resultant vector instance will have the same parallel distribution as A
.
A | ||
B |
References gridpack::math::VectorT< T, I >::clone().
MatrixT<T, I>* gridpack::math::add | ( | const MatrixT< T, I > & | A, | |
const MatrixT< T, I > & | B | |||
) |
Add two Matrix instances.
Collective.
A
and B
must have the same communicator and the same size. Different parallel distributions and nonzero patterns are OK, though.
A | ||
B |
References add(), and gridpack::math::MatrixT< T, I >::clone().
void gridpack::math::add | ( | const MatrixT< T, I > & | A, | |
const MatrixT< T, I > & | B, | |||
MatrixT< T, I > & | result | |||
) |
Add two Matrix instances and put the result in a third.
References gridpack::math::MatrixT< T, I >::add(), and gridpack::math::MatrixT< T, I >::equate().
void gridpack::math::binary_operation | ( | const unsigned int & | size, | |
StorageType * | x1, | |||
const StorageType * | x2, | |||
base_binary_function< T > & | op | |||
) |
This function combines two arrays of type T
that are stored as type StorageType
using some operation. The values in x1
are replaced with the result of the operation.
In this implementation, it is assumed that types T
and StorageType
are the same or castable to each other and that one StorageType
element is used to represent one T
element.
size | ||
x1 | ||
x2 | ||
op |
void gridpack::math::binary_operation< ComplexType, RealType > | ( | const unsigned int & | size, | |
RealType * | x1, | |||
const RealType * | x2, | |||
base_binary_function< ComplexType > & | op | |||
) |
This function combines two arrays of type T
that are stored as type StorageType
using some operation. The values in x1
are replaced with the result of the operation.
In this specialization, ComplexType values are stored in a RealType vector, two RealType values are used for each ComplexType. So, temporary ComplexType's are made from 2 RealType entries, operated on, then split back into two RealType elements.
size | ||
x1 | ||
x2 | ||
op |
void gridpack::math::binary_operation< RealType, ComplexType > | ( | const unsigned int & | size, | |
ComplexType * | x1, | |||
const ComplexType * | x2, | |||
base_binary_function< RealType > & | op | |||
) |
This function combines two arrays of type T
that are stored as type StorageType
using some operation. The values in x1
are replaced with the result of the operation.
size | ||
x1 | ||
x2 | ||
op |
VectorT<T, I>* gridpack::math::column | ( | const MatrixT< T, I > & | A, | |
const int & | cidx | |||
) |
Get a column from the Matrix and put in new Vector.
A | ||
cidx |
References gridpack::parallel::WrappedDistributed::communicator(), and gridpack::math::BaseMatrixInterface< T, I >::localRows().
void gridpack::math::column | ( | const MatrixT< T, I > & | A, | |
const int & | cidx, | |||
VectorT< T, I > & | x | |||
) |
Get a column from the Matrix and put in specified Vector.
A | ||
cidx | ||
x |
VectorT<T, I>* gridpack::math::conjugate | ( | const VectorT< T, I > & | x | ) |
Create a vector containing the complex conjugate of x
.
x | existing vector with complex values |
x
References gridpack::math::VectorT< T, I >::clone().
MatrixT<T, I>* gridpack::math::conjugate | ( | const MatrixT< T, I > & | A | ) |
Create a new matrix containing the complex conjugate of the specified matrix.
References gridpack::math::MatrixT< T, I >::clone(), and gridpack::math::BaseMatrixInterface< T, I >::conjugate().
MatrixT<T, I>* gridpack::math::diagonal | ( | const VectorT< T, I > & | x, | |
const MatrixStorageType & | stype = Sparse | |||
) |
Make a diagonal Matrix from a Vector.
Collective.
This
x |
References gridpack::parallel::WrappedDistributed::communicator(), gridpack::math::BaseVectorInterface< T, I >::getElement(), gridpack::math::BaseVectorInterface< T, I >::localIndexRange(), gridpack::math::BaseVectorInterface< T, I >::localSize(), gridpack::math::BaseMatrixInterface< T, I >::ready(), and gridpack::math::BaseMatrixInterface< T, I >::setElement().
VectorT<T, I>* gridpack::math::diagonal | ( | const MatrixT< T, I > & | A | ) |
Get the diagonal from a Matrix and put in new Vector.
Collective.
A |
A
References gridpack::parallel::WrappedDistributed::communicator(), and gridpack::math::BaseMatrixInterface< T, I >::localRows().
void gridpack::math::diagonal | ( | const MatrixT< T, I > & | A, | |
VectorT< T, I > & | d | |||
) |
Get the diagonal from a Matrix and put it in specified Vector.
A | ||
x |
Get the diagonal from a Matrix and put it in specified Vector.
Collective.
A | ||
x |
A
References gridpack::math::BaseMatrixInterface< T, I >::getElement(), gridpack::math::BaseMatrixInterface< T, I >::localRowRange(), gridpack::math::BaseVectorInterface< T, I >::ready(), and gridpack::math::BaseVectorInterface< T, I >::setElement().
To gridpack::math::equate | ( | const From & | f | ) |
This allows a general way to do "x = y"
f |
RealType gridpack::math::equate< RealType, ComplexType > | ( | const ComplexType & | f | ) |
void gridpack::math::Finalize | ( | void | ) |
Do whatever is necessary to shut down the math library.
MatrixT<T, I>* gridpack::math::identity | ( | const MatrixT< T, I > & | A | ) |
Make an identity matrix with the same ownership as the specified matrix.
References gridpack::math::MatrixT< T, I >::clone().
VectorT<T, I>* gridpack::math::imaginary | ( | const VectorT< T, I > & | x | ) |
Create a vector containing the imaginar part of the specified vector.
x | existing vector with complex values |
x
References gridpack::math::VectorT< T, I >::clone().
MatrixT<T, I>* gridpack::math::imaginary | ( | const MatrixT< T, I > & | A | ) |
Create a new matrix containing the imaginary part of the specified matrix.
References gridpack::math::MatrixT< T, I >::clone(), and gridpack::math::BaseMatrixInterface< T, I >::imaginary().
void gridpack::math::Initialize | ( | int * | , | |
char *** | ||||
) |
bool gridpack::math::Initialized | ( | void | ) |
Is the math library initialized?
MatrixT<T, I>* gridpack::math::matrixLoadBinary | ( | const parallel::Communicator & | comm, | |
const char * | filename | |||
) |
Create a new matrix and load its contents from the specified (binary) file.
VectorT<T, I>* gridpack::math::multiply | ( | const MatrixT< T, I > & | A, | |
const VectorT< T, I > & | x | |||
) |
Multiply a Matrix by a Vector and make a new Vector for the result.
A | ||
x |
References gridpack::parallel::WrappedDistributed::communicator(), and gridpack::math::BaseMatrixInterface< T, I >::localRows().
MatrixT<T, I>* gridpack::math::multiply | ( | const MatrixT< T, I > & | A, | |
const MatrixT< T, I > & | B | |||
) |
Multiply two Matrix instances and make a new one.
A | ||
B |
void gridpack::math::multiply | ( | const MatrixT< T, I > & | A, | |
const VectorT< T, I > & | x, | |||
VectorT< T, I > & | result | |||
) |
Multiply a Matrix by a Vector and put result in existing Vector.
A
, x
, and result
must all have the same communicator. x
and result
must be the same size. The length of x
must be the number of columns in A
. If these conditions are not met, an exception is thrown.
A | ||
x | ||
result |
void gridpack::math::multiply | ( | const MatrixT< T, I > & | A, | |
const MatrixT< T, I > & | B, | |||
MatrixT< T, I > & | result | |||
) |
Multiply two Matrix instances and put result in existing Matrix.
A | ||
B | ||
result |
VectorT<T, I>* gridpack::math::real | ( | const VectorT< T, I > & | x | ) |
Create a vector containing the real part of the specified vector.
x | existing vector with complex values |
x
References gridpack::math::VectorT< T, I >::clone().
MatrixT<T, I>* gridpack::math::real | ( | const MatrixT< T, I > & | A | ) |
Create a new matrix containing the real part of the specified matrix.
References gridpack::math::MatrixT< T, I >::clone(), and gridpack::math::BaseMatrixInterface< T, I >::real().
MatrixT<T, I>* gridpack::math::storageType | ( | const MatrixT< T, I > & | A, | |
const MatrixStorageType & | new_type | |||
) |
Create a copy of a Matrix, possibly with a different storage type.
MatrixT<T, I>* gridpack::math::transpose | ( | const MatrixT< T, I > & | A | ) |
Make the transpose of a Matrix.
Collective.
A |
void gridpack::math::transpose | ( | const MatrixT< T, I > & | A, | |
MatrixT< T, I > & | result | |||
) |
Make the transpose of a Matrix and put it in another.
A | ||
result |
VectorT<T, I>* gridpack::math::transposeMultiply | ( | const MatrixT< T, I > & | A, | |
const VectorT< T, I > & | x | |||
) |
Multiply the transpose of a Matrix by a Vector and make a new Vector for the result.
A | ||
x |
References gridpack::parallel::WrappedDistributed::communicator(), and gridpack::math::BaseVectorInterface< T, I >::localSize().
void gridpack::math::transposeMultiply | ( | const MatrixT< T, I > & | A, | |
const VectorT< T, I > & | x, | |||
VectorT< T, I > & | result | |||
) |
Multiply the transpose of a Matrix by a Vector and put the result in existing Vector.
A | ||
x | ||
result | same size and distribution as x |
void gridpack::math::unary_operation | ( | const unsigned int & | size, | |
StorageType * | x, | |||
base_unary_function< T > & | op | |||
) |
This function applies an operator to each element in an array of type T that is stored in an array of type StorageType
. The values array are
replaced.
In this implementation, it is assumed that types T
and StorageType
are the same or castable to each other.
size | the number of type T elements to be operated on | |
x | the elements stored as StorageType | |
op |
void gridpack::math::unary_operation< ComplexType, RealType > | ( | const unsigned int & | size, | |
RealType * | x, | |||
base_unary_function< ComplexType > & | op | |||
) |
In this specialization, ComplexType values are stored in a RealType vector, two RealType values are used for each ComplexType. So, a temporary ComplexType is made from 2 RealType entries, operated on, then split back into two RealType elements.
size | ||
x | ||
op |
void gridpack::math::unary_operation< RealType, ComplexType > | ( | const unsigned int & | size, | |
ComplexType * | x, | |||
base_unary_function< RealType > & | op | |||
) |
In this specialization, RealType values are stored in a ComplexType array. It is assumed that only the real part is used.
size | ||
x | ||
op |